import React, { Component } from 'react'

export default class ClassFn extends Component {
    state = {
        count: 10,
    }
    changeCount = () => {
        this.setState({
            count: this.state.count + 1
        })
    }
    render() {
        return (
            <div>
                <h1>类组件</h1>
                <div>{this.state.count}</div>
                <button onClick={this.changeCount} style={{ backgroundColor: 'blue', color: 'white', width: '100px', height: '40px', fontSize: '18px' }}>+1</button>
            </div >
        )
    }
}

